package com.springboot;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinTask;
import java.util.concurrent.RecursiveTask;

@SpringBootApplication
public class SpringbootPagerApplication {

    private static final int _1MB = 1024 * 1024;
    static Logger logger = LoggerFactory.getLogger(SpringbootPagerApplication.class);
    private int inte;
    private int stackLen;

    public static void main(String[] args) {
       SpringApplication.run(SpringbootPagerApplication.class, args);

        //new SpringbootPagerApplication().test();
        SpringbootPagerApplication oom = new SpringbootPagerApplication();

        /*try {
            oom.stackTest();
        }catch (Throwable e){
            System.out.println(" ===== "+oom.stackLen);
            throw e;
        }*/

        String str2 = new StringBuilder("ja").append("va").toString();
        System.out.println(str2.intern() == str2);

        String str1 = new StringBuilder("计算机").append("软件").toString();
        System.out.println(str1.intern() == str1);


        byte[] allocation1 = new byte[2 * _1MB];


        logger.info("2019-04-02  【【【【【消息队列-消息提供者启动成功.】】】】】");
    }

    public void heapTest() {
        System.out.println(inte);

        List<SpringbootPagerApplication> list = new ArrayList<>();

        for (; ; ) {
            list.add(new SpringbootPagerApplication());
        }
    }

    public void stackTest() {
        stackLen++;
        stackTest();
    }


}